
//'..'符号表示相对路径
//import导入组件
import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '../components/HelloWorld'
import index from '../views/index'
import home from '../views/home/Index'
import collection from '../views/collection/index'
import rss from '../views/rss/Index';
import ChannelDetail from '../views/channel/Detail'
import channel from '../views/channel/Index'
import articalAdd from '../views/artical/Add'
import login from '../views/admin/user/Login'
import register from '../views/admin/user/Register'
import channelAdd from '../views/channel/Add'
import ArticalDetail from "../views/artical/ArticalDetail";
import Artical from "../views/artical/Index";
import User from "../views/admin/user/Index"
import Admin from "../views/admin/Index"
import VipManage from "../views/admin/vip/manage/Index"
import VipManageAdd from "../views/admin/vip/manage/Add"
import VipOpen from "../views/admin/vip/manage/Open";
import VipLevel from '../views/admin/vip/level/Index';
import LevelAdd from '../views/admin/vip/level/Add';
import VipVoucher from '../views/admin/vip/voucher/Index';
import VoucherAdd from '../views/admin/vip/voucher/Add';
import ChannelManage from '../views/admin/channel/Index';
import ArticalManage  from '../views/admin/artical/Index';
import Qun from '../views/qun/Index';
Vue.use(Router)
//导出接口供其他页面调用
export default new Router({
  mode: "history",//去掉#号
  routes: [
    // {
    //   path: '/',
    //   name: 'HelloWorld',
    //   component: HelloWorld
    // }
    {
      //主页
      //路径
      path:'/',
      //组件 组件的加载需要导入才能使用
      component:index,
      //默认加载首页
      redirect:'/',

      //子页
      children:[
        //首页
        {
          path:'/',
          component:home,
          name:'home',
          // children:[

          //   { path:'/home/ArticalDetails',component:ArticalDetails}

          // ]


      },
        //收藏
        {path:'/collection',component:collection},
        //订阅
        {path:'/rss',component:rss},
        //频道详情
        {path:'/channel/detail',component:ChannelDetail,name:'channelDetail'},




        //频道
        {path:'/channel',component:channel},
        //添加频道
        {path:'/channelAdd',component:channelAdd,name:"channelAdd"},

        //帖子
        {path:'/Artical',component:Artical,name:"artical"},
        //帖子详情
        {path:'/ArticalDetails',component:ArticalDetail},
        //发帖子
        {path:'/articalAdd',component:articalAdd,name:"articalAdd"},
        //前台登陆
        {path:'/login',component:login,name:'frontLogin'},
        //注册
        {path:'/register',component:register,name:'frontRegister'},
        //群
        {path:'/qun',component:Qun,name:'qun'},

        //管理
        {
          path:'/admin',
          component:Admin,
          name:"admin",
          //默认加载首页
          redirect:'/admin/user',
          children: [
            //用户管理
            {path:'/admin/user',component:User,name:"user"},
            //登陆
            {path:'/admin/login',component:login,name:'login'},
            //注册
            {path:'/admin/register',component:register,name:'register'},
            //vip用户
            {path:'/admin/vip/manage',component:VipManage,name:"vipManage"},
            {path:'/admin/vip/manage/add',component:VipManageAdd,name:"vipManageAdd"},
            {path:'/admin/vip/manage/open',component:VipOpen,name:"vipOpen"},
            {path:'/admin/vip/level',component:VipLevel,name:"vipLevel"},
            {path:'/admin/vip/level/add',component:LevelAdd,name:"levelAdd"},
            {path:'/admin/vip/voucher',component:VipVoucher,name:"vipVoucher"},
            {path:'/admin/vip/voucher/add',component:VoucherAdd,name:"voucherAdd"},
            //频道管理
            {path:'/admin/channel',component:ChannelManage,name:"channelManage"},
            //文章管理
            {path:'/admin/artical',component:ArticalManage,name:"articalManage"},

          ]

        },









      ]
    },

  ]
})
